package org.hsqldb.index;

import org.hsqldb.Row;
import org.hsqldb.RowBPlus;
import org.hsqldb.TableBase;

import org.hsqldb.lib.IntLookup;
import org.hsqldb.persist.CachedObject;
import org.hsqldb.persist.PersistentStore;
import org.hsqldb.rowio.RowInputInterface;
import org.hsqldb.rowio.RowOutputInterface;

public abstract class NodeBTree extends Row implements CachedObject{
	//public static int SIZE_IN_BYTE = 5 * 4;
	
	public NodeBTree(TableBase table, Object[] data) {
		super(table, data);
		// TODO Auto-generated constructor stub
	}

	public static final int TREE_NODE_LENGTH = 100;
	public static final int NO_POS = -1;
    public NodeBTree nodeNextIndex;// node of next index (nNext==null || nNext.iId=iId+1)
    
    NodeBTree nodeParent;
    int positionInParent = NO_POS;

	public void delete() {
		
    }

    public int getPositionInParent(){
    	return positionInParent;
    }
    
    public NodeBTree getParent(PersistentStore store){
    	return nodeParent;
    }
    public void setParent(PersistentStore store,NodeBTree p,int pos){
    	nodeParent = p;
    	positionInParent = pos;
    }

    boolean equals(NodeBTree n) {
        return n == this;
    }

    public void setInMemory(boolean in) {}

    public void write(RowOutputInterface out) {}

    public void write(RowOutputInterface out, IntLookup lookup) {}

    public int getPos() {
        return 0;
    }

    public void updateAccessCount(int count) {}

    public int getAccessCount() {
        return 0;
    }

    public void setStorageSize(int size) {}

    public int getStorageSize() {
        return 0;
    }

    public void setPos(int pos) {
    }

    public boolean hasChanged() {
        return false;
    }

    public boolean isKeepInMemory() {
        return false;
    }
    ;

    public boolean keepInMemory(boolean keep) {
        return true;
    }

    public boolean isInMemory() {
        return false;
    }

    public void restore() {}

    public void destroy() {}

    public int getRealSize(RowOutputInterface out) {
        return 0;
    }

    public boolean isMemory() {
        return true;
    }

}
